<%@ Page Language="C#" Inherits="My.Blog.Web.Controllers.BasePage" AutoEventWireup="false" %>
<%@import namespace="System" %>
<%@import namespace="System.Threading" %>
<%@import namespace="System.Collections.Generic" %>
<%@import namespace="My.Blog.Domain.Entities" %>
<%@import namespace="My.Blog.Domain.Interfaces" %>
<%@import namespace="My.Blog.Business.Service" %>
<%@import namespace="My.Blog.Business.Security" %>
<%@import namespace="My.Blog.Web.Controllers" %>
<script runat="server">
/////////////////////////////////////////////////////////////////
//File: BlogInfo.cs
//Description: 
//  Ajax 代码
//  
//Copyright© 2011 Moliu
//History:
//  2011-2-27 14:20:54    CodeSmith5.0.1    Original Version
//  2011-4-20 23:19:06    MoLiu             1
/////////////////////////////////////////////////////////////////

</script>
<%
    IBlogs manager = new BizFactory().CreateBlog();
    
    // 检测是否已登录用户
    if (true == SecurityUtility.IsLogon)
    {
        Response.Write("要注册新的博客，请先<a href='Login.aspx?Op=LogoutUser'>退出</a>当前登录博客！");
        Response.End();
    }

%><!doctype html>
<html>
<head id="Head1" runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>列表页</title>
    <script type="text/javascript" src="_Resources/Js/jquery.pack.js"></script>
    <script type="text/javascript" src="_Resources/Js/jquery.plugins.js"></script>
</head>
<body>

    <div id="breadcrumb">
        <span class="link"><a href="Index.aspx" title="首页">首页</a></span>
        <span class="divider">&gt;</span>
        <span class="target">注册</span>
    </div>
    
    <form id="FrmRegister" method="post" action="_Ajax/Blog.aspx?op=CreateBlog">
    <h1>注册</h1>
    <div>
        博客名: <input type="text" name="Name" />
        登录名:  <input type="text" name="Owner" />
        密码: <input type="password" name="Password" />
        确认密码: <input type="password" name="Password2" />
        <input type="submit" value="提交" />
    </div>
    </form>
    
    <p><a href="Login.aspx">登录</a></p>
    
<script type="text/javascript">
    $("#FrmRegister").ajaxSubmit( function(dat){
        if( dat.response ){
            location.href = 'Login.aspx';
        }
        else{
            alert(dat.error||"");
        }
    } );
</script> 
</body>
</html>